package com.ruoyi.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.LhqWorkCategoryMapper;
import com.ruoyi.domain.LhqWorkCategory;
import com.ruoyi.service.ILhqWorkCategoryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 著作类别Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-09-08
 */
@Service
public class LhqWorkCategoryServiceImpl implements ILhqWorkCategoryService 
{
    @Autowired
    private LhqWorkCategoryMapper lhqWorkCategoryMapper;

    /**
     * 查询著作类别
     * 
     * @param id 著作类别ID
     * @return 著作类别
     */
    @Override
    public LhqWorkCategory selectLhqWorkCategoryById(Long id)
    {
        return lhqWorkCategoryMapper.selectLhqWorkCategoryById(id);
    }

    /**
     * 查询著作类别列表
     * 
     * @param lhqWorkCategory 著作类别
     * @return 著作类别
     */
    @Override
    public List<LhqWorkCategory> selectLhqWorkCategoryList(LhqWorkCategory lhqWorkCategory)
    {
        return lhqWorkCategoryMapper.selectLhqWorkCategoryList(lhqWorkCategory);
    }

    /**
     * 新增著作类别
     * 
     * @param lhqWorkCategory 著作类别
     * @return 结果
     */
    @Override
    public int insertLhqWorkCategory(LhqWorkCategory lhqWorkCategory)
    {
        return lhqWorkCategoryMapper.insertLhqWorkCategory(lhqWorkCategory);
    }

    /**
     * 修改著作类别
     * 
     * @param lhqWorkCategory 著作类别
     * @return 结果
     */
    @Override
    public int updateLhqWorkCategory(LhqWorkCategory lhqWorkCategory)
    {
        return lhqWorkCategoryMapper.updateLhqWorkCategory(lhqWorkCategory);
    }

    /**
     * 删除著作类别对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLhqWorkCategoryByIds(String ids)
    {
        return lhqWorkCategoryMapper.deleteLhqWorkCategoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除著作类别信息
     * 
     * @param id 著作类别ID
     * @return 结果
     */
    @Override
    public int deleteLhqWorkCategoryById(Long id)
    {
        return lhqWorkCategoryMapper.deleteLhqWorkCategoryById(id);
    }

    @Override
    public LhqWorkCategory selectByName(String category) {
        return lhqWorkCategoryMapper.selectByName(category);
    }
}
